import interestrates_pb2
from protobuf.socketrpc import RpcService

import logging
log = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG)

hostname = 'localhost'
port = 8090

request = interestrates_pb2.interestRateCurve()

service = RpcService(interestrates_pb2.PushService_Stub, port, hostname)

def callback(request, response):
	log.info("Asynchronous response: "+response__str__())

try:
	log.info("Making asynchronous call")
	response = service.Push(request, callback=callback)
except	Exception, ex:
	log.exception(ex)
